package com.xiangge.synthesize.config;

import com.xiangge.util.SynthesizeResponse;
import org.springframework.core.annotation.Order;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@Order
public class GlobalExceptionHandler {


    @ExceptionHandler(Exception.class)
    @ResponseBody
    public SynthesizeResponse badArgumentHandler(Exception e) {
        return SynthesizeResponse.error();
    }

}
